//
//  EGAAbsentTypeCellInfo.m
//  Intranet
//
//  Created by gad on 6/25/55 BE.
//  Copyright (c) 2555 __MyCompanyName__. All rights reserved.
//

#import "EGAAbsentTypeCellInfo.h"

@implementation EGAAbsentTypeCellInfo

@synthesize absentTotal;
@synthesize absentIconName;
@synthesize absentTypeName;
@synthesize absentTypeID;

-(id)initWithID:(NSInteger)aID Name:(NSString*)name iconName:(NSString*)iconName andTotalUnit:(NSInteger)timeUnit 
{
    self = [super init];
    if (self) {
        absentTypeID = aID;
        absentTypeName = name;
        absentIconName = iconName;
        [self setTimeUnit:timeUnit withRate:8];
    }
    return self;
}

-(void)setTimeUnit:(NSInteger)timeUnit withRate:(NSInteger)rate
{
    
    absentTotal = [NSString stringWithFormat:@"จำนวนวันคงเหลือ %d วัน %d ช.ม.",timeUnit/rate,timeUnit%rate];
}

@end
